package com.mvp.mvpdemo.mvp.contract

import com.mvp.mvpdemo.base.IBaseView
import com.mvp.mvpdemo.base.IModel
import com.mvp.mvpdemo.base.IPresenter
import com.mvp.mvpdemo.bean.LoginBean
import com.mvp.mvpdemo.bean.UpLoadFile
import retrofit2.Call
import java.io.File


/**
 * author    : mahongyin
 * e-mail    : mhy.work@foxmail.com
 * date      : 2020-10-28 9:16
 * introduce :
 */
interface LoginContract {

    interface View : IBaseView {
        fun loginSusscess(result: LoginBean)
        fun logoutSusscess(result: LoginBean)
        fun error(error: String)
    }

    interface Presenter : IPresenter<View> {
         fun login(phone: String, pwd: String)
        fun logout()
        fun upLaodFile(file: File)
        fun upLaodFiles(user: String, token: String, file: File)
    }

    interface Model : IModel {
        fun login(phone: String, pwd: String): Call<LoginBean>
        suspend fun loginCC(phone: String, pwd: String): LoginBean

        fun logout(): Call<LoginBean>
        fun upLoadFile(requestBody: File): Call<UpLoadFile>?
        fun upLoadFiles(user: String, token: String, file: File): Call<UpLoadFile>?

    }

}